package testcase.validationtest;

import junit.framework.TestCase;
import validation.*;
import card.Card;
import card.Cardset;

public class NukeTest extends TestCase{
	private Type nuke;
	private Cardset cardset;
	@Override
	public void setUp(){
		cardset = new Cardset(2);
		nuke = Nuke.getInstance();
	}
	@Override
	public void tearDown(){
		nuke.clear();
		nuke=null;
	}
	// testcases
	public void testCorr1(){
		cardset = new Cardset(2);
		cardset.clear();
		cardset.add(new Card('g','B'));
		cardset.add(new Card('g','R'));
		assertEquals(Nuke.getInstance().identify(cardset), nuke);
	}
	public void testCorr2(){
		cardset = new Cardset(2);
		cardset.clear();
		cardset.add(new Card('g','R'));
		cardset.add(new Card('g','B'));
		assertEquals(Nuke.getInstance().identify(cardset), nuke);
	}
	public void testInCorr1(){
		cardset = new Cardset(2);
		cardset.clear();
		cardset.add(new Card('s','2'));
		cardset.add(new Card('g','B'));
		assertEquals(Nuke.getInstance().identify(cardset), null);
	}
	public void testInCorr2(){
		cardset = new Cardset(3);
		cardset.clear();
		cardset.add(new Card('g','R'));
		cardset.add(new Card('g','B'));
		cardset.add(new Card('s','2'));
		assertEquals(Nuke.getInstance().identify(cardset), null);
	}
}
